package com.jiang.annotation.valid.test.service;

import com.jiang.annotation.valid.test.User;

import org.hibernate.validator.constraints.CreditCardNumber;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.Size;

@Validated
public interface ValidServiceA {

    boolean saveUserA(@Valid User user);

    void print(@Size(min = 2, max = 3, message = "长度必须介于{min}-{max}") String name,
               @CreditCardNumber(message = "非法卡账号") String cardNo);

    boolean saveUserAToB(User user);
}
